-- -*- mode: lua; -*-

return bd.system
{
   imports = {
      "stdtypes",
      "ptrig",
      "lfds_cyclic",
      "platform_2dof",
      "platform_2dof_control",
      "mqueue"
   },

   blocks = {
      { name="plat1", type="platform_2dof" },
      { name="control1", type="platform_2dof_control" },
      { name="ptrig1", type="ubx/ptrig" },
   },

   configurations = {
      { name="plat1", config = {
	   initial_position={1.1,1},
	   joint_velocity_limits={0.5,0.5} }
      },

      { name="control1", config = {  gain=0.1, target_pos={4.5,4.5} } },

      { name="ptrig1", config = { period = {sec=0, usec=100000 },
				  sched_policy="SCHED_OTHER",
				  sched_priority=0,
				  chain0={
				     { b="#plat1" },
				     { b="#control1" } } } },
   },

   connections = {
      { src="plat1.pos", tgt="control1.measured_pos" },
      { src="control1.commanded_vel",tgt="plat1.desired_vel" },
      { src="plat1.pos", type="ubx/mqueue" },
      { src="control1.commanded_vel", type="ubx/mqueue" },
   },
}
